﻿using System;
using System.Reflection;

namespace Ue.Aop.Fody.Samples.Methods
{
    public interface IMethodDecorator
    {
        /// <summary>
        /// MethodInfo开始执行之前
        /// </summary>
        /// <param name="method"></param>
        void OnEntry(object sender, MethodBase method);

        /// <summary>
        /// MethodInfo执行执行完毕后
        /// </summary>
        /// <param name="method"></param>
        void OnExit(object sender, MethodBase method, object returnValue);

        /// <summary>
        /// MethodInfo抛出异常时
        /// </summary>
        /// <param name="method"></param>
        /// <param name="exception"></param>
        void OnException(object sender, MethodBase method, Exception exception);
    }
}
